#!/usr/bin/env python
#coding=utf-8
#迭代的方式占用内存较小，适合大文件的情况。

import csv

def readcsv(filename):
    return csv.reader(open(filename,'rb'),delimiter=',',quotechar='|')

def main():
    file1=r'c:/temp/csv1.csv'
    file2=r'c:/temp/csv2.csv'

    for d1it in readcsv(file1):
        print 'd1it:',d1it
        for d2it in readcsv(file2):     
            print 'd2it:',d2it
            
    return 0
    
if __name__ == '__main__':
    main()
    print 'done'
